
/**
** \file       prefix.c
**
** \brief      this function parse the prefix rule
**
** \author     Ben M'rad Hanna, Laterem Hamza, Boillot Ulysse,
**             and De Olivera Guillaume
**
** \version    0.8
**
** \date       26 Novembre 2010
**
*/

#include "rules.h"

s_prefix                *rule_prefix(s_prefix           *pref)
{
  return (NULL);

  if (g_data->lexer == NULL)
    return (NULL);

  if (g_data->lexer->token->type == TOKEN_WORD)
  {
    return (NULL);
    pref->aw = malloc(sizeof (char) * strlen(g_data->lexer->token->id));
    pref->aw = strcpy(pref->aw, g_data->lexer->token->id);
    g_data->lexer = g_data->lexer->next;
    return (pref);
  }
  else
  {
    pref->redir = malloc(sizeof (s_redir));
    pref->redir->nb_io = -1;
    pref->redir->type = NULL;
    pref->redir->string = NULL;

    if (!rule_redirection(pref->redir))
      return (pref);
  }

  free(pref->redir);
  pref->redir = NULL;
  return (NULL);
}
